package work.comeback.omo.util.common;

import java.time.Instant;
import java.util.Random;

public class TimeUtils {

    public static String getRandomTimestamp() {
        // 获取当前时间戳
        Instant now = Instant.now();
        long timestamp = now.toEpochMilli();

        // 生成一个随机数，范围可以根据需要设置
        Random random = new Random();
        int randomNumber = random.nextInt(10000);

        // 将时间戳和随机数合并为一个字符串
        return timestamp + String.format("%04d", randomNumber);
    }

    public static void main(String[] args) {
        String result = getRandomTimestamp();
        System.out.println("随机数 + 时间戳: " + result);
    }
}
